package com.gzx.spring.mq.controller;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gzx.risk.core.pojo.CommonResult;
import com.gzx.risk.core.tags.CommonLog;
import com.gzx.spring.mq.pojo.RiskOpMsg;
import com.gzx.spring.mq.service.RiskMqService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;

@Tag(name = "mq")
@RestController
@Validated
@RequestMapping("/api/mq")
public class MqController {
	@Resource
	private RiskMqService mqService;

	@Operation(summary = "发消息")
	@CommonLog("发消息")
	@PostMapping("/send")
	public CommonResult<String> send(@RequestBody RiskOpMsg msg) {
		mqService.send(msg);
		return CommonResult.ok();
	}
}
